Left Termination of the query pattern div_in_3(g, g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

div(X, s(Y), Z) :- div_s(X, Y, Z).
div_s(0, Y, 0).
div_s(s(X), Y, 0) :- lss(X, Y).
div_s(s(X), Y, s(Z)) :- ','(sub(X, Y, R), div_s(R, Y, Z)).
lss(s(X), s(Y)) :- lss(X, Y).
lss(0, s(Y)).
sub(s(X), s(Y), Z) :- sub(X, Y, Z).
sub(X, 0, X).

Queries:

div(g,g,a).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
div_in: (b,b,f)
div_s_in: (b,b,f)
lss_in: (b,b)
sub_in: (b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

div_in_gga(X, s(Y), Z) → U1_gga(X, Y, Z, div_s_in_gga(X, Y, Z))
div_s_in_gga(0, Y, 0) → div_s_out_gga(0, Y, 0)
div_s_in_gga(s(X), Y, 0) → U2_gga(X, Y, lss_in_gg(X, Y))
lss_in_gg(s(X), s(Y)) → U5_gg(X, Y, lss_in_gg(X, Y))
lss_in_gg(0, s(Y)) → lss_out_gg(0, s(Y))
U5_gg(X, Y, lss_out_gg(X, Y)) → lss_out_gg(s(X), s(Y))
U2_gga(X, Y, lss_out_gg(X, Y)) → div_s_out_gga(s(X), Y, 0)
div_s_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, sub_in_gga(X, Y, R))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U3_gga(X, Y, Z, sub_out_gga(X, Y, R)) → U4_gga(X, Y, Z, div_s_in_gga(R, Y, Z))
U4_gga(X, Y, Z, div_s_out_gga(R, Y, Z)) → div_s_out_gga(s(X), Y, s(Z))
U1_gga(X, Y, Z, div_s_out_gga(X, Y, Z)) → div_out_gga(X, s(Y), Z)

The argument filtering Pi contains the following mapping:
div_in_gga(x1, x2, x3)  =  div_in_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x4)
div_s_in_gga(x1, x2, x3)  =  div_s_in_gga(x1, x2)
0  =  0
div_s_out_gga(x1, x2, x3)  =  div_s_out_gga(x3)
U2_gga(x1, x2, x3)  =  U2_gga(x3)
lss_in_gg(x1, x2)  =  lss_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x3)
lss_out_gg(x1, x2)  =  lss_out_gg
U3_gga(x1, x2, x3, x4)  =  U3_gga(x2, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
div_out_gga(x1, x2, x3)  =  div_out_gga(x3)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

div_in_gga(X, s(Y), Z) → U1_gga(X, Y, Z, div_s_in_gga(X, Y, Z))
div_s_in_gga(0, Y, 0) → div_s_out_gga(0, Y, 0)
div_s_in_gga(s(X), Y, 0) → U2_gga(X, Y, lss_in_gg(X, Y))
lss_in_gg(s(X), s(Y)) → U5_gg(X, Y, lss_in_gg(X, Y))
lss_in_gg(0, s(Y)) → lss_out_gg(0, s(Y))
U5_gg(X, Y, lss_out_gg(X, Y)) → lss_out_gg(s(X), s(Y))
U2_gga(X, Y, lss_out_gg(X, Y)) → div_s_out_gga(s(X), Y, 0)
div_s_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, sub_in_gga(X, Y, R))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U3_gga(X, Y, Z, sub_out_gga(X, Y, R)) → U4_gga(X, Y, Z, div_s_in_gga(R, Y, Z))
U4_gga(X, Y, Z, div_s_out_gga(R, Y, Z)) → div_s_out_gga(s(X), Y, s(Z))
U1_gga(X, Y, Z, div_s_out_gga(X, Y, Z)) → div_out_gga(X, s(Y), Z)

The argument filtering Pi contains the following mapping:
div_in_gga(x1, x2, x3)  =  div_in_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x4)
div_s_in_gga(x1, x2, x3)  =  div_s_in_gga(x1, x2)
0  =  0
div_s_out_gga(x1, x2, x3)  =  div_s_out_gga(x3)
U2_gga(x1, x2, x3)  =  U2_gga(x3)
lss_in_gg(x1, x2)  =  lss_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x3)
lss_out_gg(x1, x2)  =  lss_out_gg
U3_gga(x1, x2, x3, x4)  =  U3_gga(x2, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
div_out_gga(x1, x2, x3)  =  div_out_gga(x3)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

DIV_IN_GGA(X, s(Y), Z) → U1_GGA(X, Y, Z, div_s_in_gga(X, Y, Z))
DIV_IN_GGA(X, s(Y), Z) → DIV_S_IN_GGA(X, Y, Z)
DIV_S_IN_GGA(s(X), Y, 0) → U2_GGA(X, Y, lss_in_gg(X, Y))
DIV_S_IN_GGA(s(X), Y, 0) → LSS_IN_GG(X, Y)
LSS_IN_GG(s(X), s(Y)) → U5_GG(X, Y, lss_in_gg(X, Y))
LSS_IN_GG(s(X), s(Y)) → LSS_IN_GG(X, Y)
DIV_S_IN_GGA(s(X), Y, s(Z)) → U3_GGA(X, Y, Z, sub_in_gga(X, Y, R))
DIV_S_IN_GGA(s(X), Y, s(Z)) → SUB_IN_GGA(X, Y, R)
SUB_IN_GGA(s(X), s(Y), Z) → U6_GGA(X, Y, Z, sub_in_gga(X, Y, Z))
SUB_IN_GGA(s(X), s(Y), Z) → SUB_IN_GGA(X, Y, Z)
U3_GGA(X, Y, Z, sub_out_gga(X, Y, R)) → U4_GGA(X, Y, Z, div_s_in_gga(R, Y, Z))
U3_GGA(X, Y, Z, sub_out_gga(X, Y, R)) → DIV_S_IN_GGA(R, Y, Z)

The TRS R consists of the following rules:

div_in_gga(X, s(Y), Z) → U1_gga(X, Y, Z, div_s_in_gga(X, Y, Z))
div_s_in_gga(0, Y, 0) → div_s_out_gga(0, Y, 0)
div_s_in_gga(s(X), Y, 0) → U2_gga(X, Y, lss_in_gg(X, Y))
lss_in_gg(s(X), s(Y)) → U5_gg(X, Y, lss_in_gg(X, Y))
lss_in_gg(0, s(Y)) → lss_out_gg(0, s(Y))
U5_gg(X, Y, lss_out_gg(X, Y)) → lss_out_gg(s(X), s(Y))
U2_gga(X, Y, lss_out_gg(X, Y)) → div_s_out_gga(s(X), Y, 0)
div_s_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, sub_in_gga(X, Y, R))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U3_gga(X, Y, Z, sub_out_gga(X, Y, R)) → U4_gga(X, Y, Z, div_s_in_gga(R, Y, Z))
U4_gga(X, Y, Z, div_s_out_gga(R, Y, Z)) → div_s_out_gga(s(X), Y, s(Z))
U1_gga(X, Y, Z, div_s_out_gga(X, Y, Z)) → div_out_gga(X, s(Y), Z)

The argument filtering Pi contains the following mapping:
div_in_gga(x1, x2, x3)  =  div_in_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x4)
div_s_in_gga(x1, x2, x3)  =  div_s_in_gga(x1, x2)
0  =  0
div_s_out_gga(x1, x2, x3)  =  div_s_out_gga(x3)
U2_gga(x1, x2, x3)  =  U2_gga(x3)
lss_in_gg(x1, x2)  =  lss_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x3)
lss_out_gg(x1, x2)  =  lss_out_gg
U3_gga(x1, x2, x3, x4)  =  U3_gga(x2, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
div_out_gga(x1, x2, x3)  =  div_out_gga(x3)
U5_GG(x1, x2, x3)  =  U5_GG(x3)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x4)
DIV_IN_GGA(x1, x2, x3)  =  DIV_IN_GGA(x1, x2)
LSS_IN_GG(x1, x2)  =  LSS_IN_GG(x1, x2)
U2_GGA(x1, x2, x3)  =  U2_GGA(x3)
DIV_S_IN_GGA(x1, x2, x3)  =  DIV_S_IN_GGA(x1, x2)
SUB_IN_GGA(x1, x2, x3)  =  SUB_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x2, x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

DIV_IN_GGA(X, s(Y), Z) → U1_GGA(X, Y, Z, div_s_in_gga(X, Y, Z))
DIV_IN_GGA(X, s(Y), Z) → DIV_S_IN_GGA(X, Y, Z)
DIV_S_IN_GGA(s(X), Y, 0) → U2_GGA(X, Y, lss_in_gg(X, Y))
DIV_S_IN_GGA(s(X), Y, 0) → LSS_IN_GG(X, Y)
LSS_IN_GG(s(X), s(Y)) → U5_GG(X, Y, lss_in_gg(X, Y))
LSS_IN_GG(s(X), s(Y)) → LSS_IN_GG(X, Y)
DIV_S_IN_GGA(s(X), Y, s(Z)) → U3_GGA(X, Y, Z, sub_in_gga(X, Y, R))
DIV_S_IN_GGA(s(X), Y, s(Z)) → SUB_IN_GGA(X, Y, R)
SUB_IN_GGA(s(X), s(Y), Z) → U6_GGA(X, Y, Z, sub_in_gga(X, Y, Z))
SUB_IN_GGA(s(X), s(Y), Z) → SUB_IN_GGA(X, Y, Z)
U3_GGA(X, Y, Z, sub_out_gga(X, Y, R)) → U4_GGA(X, Y, Z, div_s_in_gga(R, Y, Z))
U3_GGA(X, Y, Z, sub_out_gga(X, Y, R)) → DIV_S_IN_GGA(R, Y, Z)

The TRS R consists of the following rules:

div_in_gga(X, s(Y), Z) → U1_gga(X, Y, Z, div_s_in_gga(X, Y, Z))
div_s_in_gga(0, Y, 0) → div_s_out_gga(0, Y, 0)
div_s_in_gga(s(X), Y, 0) → U2_gga(X, Y, lss_in_gg(X, Y))
lss_in_gg(s(X), s(Y)) → U5_gg(X, Y, lss_in_gg(X, Y))
lss_in_gg(0, s(Y)) → lss_out_gg(0, s(Y))
U5_gg(X, Y, lss_out_gg(X, Y)) → lss_out_gg(s(X), s(Y))
U2_gga(X, Y, lss_out_gg(X, Y)) → div_s_out_gga(s(X), Y, 0)
div_s_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, sub_in_gga(X, Y, R))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U3_gga(X, Y, Z, sub_out_gga(X, Y, R)) → U4_gga(X, Y, Z, div_s_in_gga(R, Y, Z))
U4_gga(X, Y, Z, div_s_out_gga(R, Y, Z)) → div_s_out_gga(s(X), Y, s(Z))
U1_gga(X, Y, Z, div_s_out_gga(X, Y, Z)) → div_out_gga(X, s(Y), Z)

The argument filtering Pi contains the following mapping:
div_in_gga(x1, x2, x3)  =  div_in_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x4)
div_s_in_gga(x1, x2, x3)  =  div_s_in_gga(x1, x2)
0  =  0
div_s_out_gga(x1, x2, x3)  =  div_s_out_gga(x3)
U2_gga(x1, x2, x3)  =  U2_gga(x3)
lss_in_gg(x1, x2)  =  lss_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x3)
lss_out_gg(x1, x2)  =  lss_out_gg
U3_gga(x1, x2, x3, x4)  =  U3_gga(x2, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
div_out_gga(x1, x2, x3)  =  div_out_gga(x3)
U5_GG(x1, x2, x3)  =  U5_GG(x3)
U6_GGA(x1, x2, x3, x4)  =  U6_GGA(x4)
U4_GGA(x1, x2, x3, x4)  =  U4_GGA(x4)
DIV_IN_GGA(x1, x2, x3)  =  DIV_IN_GGA(x1, x2)
LSS_IN_GG(x1, x2)  =  LSS_IN_GG(x1, x2)
U2_GGA(x1, x2, x3)  =  U2_GGA(x3)
DIV_S_IN_GGA(x1, x2, x3)  =  DIV_S_IN_GGA(x1, x2)
SUB_IN_GGA(x1, x2, x3)  =  SUB_IN_GGA(x1, x2)
U1_GGA(x1, x2, x3, x4)  =  U1_GGA(x4)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x2, x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 3 SCCs with 8 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SUB_IN_GGA(s(X), s(Y), Z) → SUB_IN_GGA(X, Y, Z)

The TRS R consists of the following rules:

div_in_gga(X, s(Y), Z) → U1_gga(X, Y, Z, div_s_in_gga(X, Y, Z))
div_s_in_gga(0, Y, 0) → div_s_out_gga(0, Y, 0)
div_s_in_gga(s(X), Y, 0) → U2_gga(X, Y, lss_in_gg(X, Y))
lss_in_gg(s(X), s(Y)) → U5_gg(X, Y, lss_in_gg(X, Y))
lss_in_gg(0, s(Y)) → lss_out_gg(0, s(Y))
U5_gg(X, Y, lss_out_gg(X, Y)) → lss_out_gg(s(X), s(Y))
U2_gga(X, Y, lss_out_gg(X, Y)) → div_s_out_gga(s(X), Y, 0)
div_s_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, sub_in_gga(X, Y, R))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U3_gga(X, Y, Z, sub_out_gga(X, Y, R)) → U4_gga(X, Y, Z, div_s_in_gga(R, Y, Z))
U4_gga(X, Y, Z, div_s_out_gga(R, Y, Z)) → div_s_out_gga(s(X), Y, s(Z))
U1_gga(X, Y, Z, div_s_out_gga(X, Y, Z)) → div_out_gga(X, s(Y), Z)

The argument filtering Pi contains the following mapping:
div_in_gga(x1, x2, x3)  =  div_in_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x4)
div_s_in_gga(x1, x2, x3)  =  div_s_in_gga(x1, x2)
0  =  0
div_s_out_gga(x1, x2, x3)  =  div_s_out_gga(x3)
U2_gga(x1, x2, x3)  =  U2_gga(x3)
lss_in_gg(x1, x2)  =  lss_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x3)
lss_out_gg(x1, x2)  =  lss_out_gg
U3_gga(x1, x2, x3, x4)  =  U3_gga(x2, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
div_out_gga(x1, x2, x3)  =  div_out_gga(x3)
SUB_IN_GGA(x1, x2, x3)  =  SUB_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SUB_IN_GGA(s(X), s(Y), Z) → SUB_IN_GGA(X, Y, Z)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
SUB_IN_GGA(x1, x2, x3)  =  SUB_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

SUB_IN_GGA(s(X), s(Y)) → SUB_IN_GGA(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LSS_IN_GG(s(X), s(Y)) → LSS_IN_GG(X, Y)

The TRS R consists of the following rules:

div_in_gga(X, s(Y), Z) → U1_gga(X, Y, Z, div_s_in_gga(X, Y, Z))
div_s_in_gga(0, Y, 0) → div_s_out_gga(0, Y, 0)
div_s_in_gga(s(X), Y, 0) → U2_gga(X, Y, lss_in_gg(X, Y))
lss_in_gg(s(X), s(Y)) → U5_gg(X, Y, lss_in_gg(X, Y))
lss_in_gg(0, s(Y)) → lss_out_gg(0, s(Y))
U5_gg(X, Y, lss_out_gg(X, Y)) → lss_out_gg(s(X), s(Y))
U2_gga(X, Y, lss_out_gg(X, Y)) → div_s_out_gga(s(X), Y, 0)
div_s_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, sub_in_gga(X, Y, R))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U3_gga(X, Y, Z, sub_out_gga(X, Y, R)) → U4_gga(X, Y, Z, div_s_in_gga(R, Y, Z))
U4_gga(X, Y, Z, div_s_out_gga(R, Y, Z)) → div_s_out_gga(s(X), Y, s(Z))
U1_gga(X, Y, Z, div_s_out_gga(X, Y, Z)) → div_out_gga(X, s(Y), Z)

The argument filtering Pi contains the following mapping:
div_in_gga(x1, x2, x3)  =  div_in_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x4)
div_s_in_gga(x1, x2, x3)  =  div_s_in_gga(x1, x2)
0  =  0
div_s_out_gga(x1, x2, x3)  =  div_s_out_gga(x3)
U2_gga(x1, x2, x3)  =  U2_gga(x3)
lss_in_gg(x1, x2)  =  lss_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x3)
lss_out_gg(x1, x2)  =  lss_out_gg
U3_gga(x1, x2, x3, x4)  =  U3_gga(x2, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
div_out_gga(x1, x2, x3)  =  div_out_gga(x3)
LSS_IN_GG(x1, x2)  =  LSS_IN_GG(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LSS_IN_GG(s(X), s(Y)) → LSS_IN_GG(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

LSS_IN_GG(s(X), s(Y)) → LSS_IN_GG(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

U3_GGA(X, Y, Z, sub_out_gga(X, Y, R)) → DIV_S_IN_GGA(R, Y, Z)
DIV_S_IN_GGA(s(X), Y, s(Z)) → U3_GGA(X, Y, Z, sub_in_gga(X, Y, R))

The TRS R consists of the following rules:

div_in_gga(X, s(Y), Z) → U1_gga(X, Y, Z, div_s_in_gga(X, Y, Z))
div_s_in_gga(0, Y, 0) → div_s_out_gga(0, Y, 0)
div_s_in_gga(s(X), Y, 0) → U2_gga(X, Y, lss_in_gg(X, Y))
lss_in_gg(s(X), s(Y)) → U5_gg(X, Y, lss_in_gg(X, Y))
lss_in_gg(0, s(Y)) → lss_out_gg(0, s(Y))
U5_gg(X, Y, lss_out_gg(X, Y)) → lss_out_gg(s(X), s(Y))
U2_gga(X, Y, lss_out_gg(X, Y)) → div_s_out_gga(s(X), Y, 0)
div_s_in_gga(s(X), Y, s(Z)) → U3_gga(X, Y, Z, sub_in_gga(X, Y, R))
sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)
U3_gga(X, Y, Z, sub_out_gga(X, Y, R)) → U4_gga(X, Y, Z, div_s_in_gga(R, Y, Z))
U4_gga(X, Y, Z, div_s_out_gga(R, Y, Z)) → div_s_out_gga(s(X), Y, s(Z))
U1_gga(X, Y, Z, div_s_out_gga(X, Y, Z)) → div_out_gga(X, s(Y), Z)

The argument filtering Pi contains the following mapping:
div_in_gga(x1, x2, x3)  =  div_in_gga(x1, x2)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3, x4)  =  U1_gga(x4)
div_s_in_gga(x1, x2, x3)  =  div_s_in_gga(x1, x2)
0  =  0
div_s_out_gga(x1, x2, x3)  =  div_s_out_gga(x3)
U2_gga(x1, x2, x3)  =  U2_gga(x3)
lss_in_gg(x1, x2)  =  lss_in_gg(x1, x2)
U5_gg(x1, x2, x3)  =  U5_gg(x3)
lss_out_gg(x1, x2)  =  lss_out_gg
U3_gga(x1, x2, x3, x4)  =  U3_gga(x2, x4)
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
U4_gga(x1, x2, x3, x4)  =  U4_gga(x4)
div_out_gga(x1, x2, x3)  =  div_out_gga(x3)
DIV_S_IN_GGA(x1, x2, x3)  =  DIV_S_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x2, x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

U3_GGA(X, Y, Z, sub_out_gga(X, Y, R)) → DIV_S_IN_GGA(R, Y, Z)
DIV_S_IN_GGA(s(X), Y, s(Z)) → U3_GGA(X, Y, Z, sub_in_gga(X, Y, R))

The TRS R consists of the following rules:

sub_in_gga(s(X), s(Y), Z) → U6_gga(X, Y, Z, sub_in_gga(X, Y, Z))
sub_in_gga(X, 0, X) → sub_out_gga(X, 0, X)
U6_gga(X, Y, Z, sub_out_gga(X, Y, Z)) → sub_out_gga(s(X), s(Y), Z)

The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
0  =  0
sub_in_gga(x1, x2, x3)  =  sub_in_gga(x1, x2)
U6_gga(x1, x2, x3, x4)  =  U6_gga(x4)
sub_out_gga(x1, x2, x3)  =  sub_out_gga(x3)
DIV_S_IN_GGA(x1, x2, x3)  =  DIV_S_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x2, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

U3_GGA(Y, sub_out_gga(R)) → DIV_S_IN_GGA(R, Y)
DIV_S_IN_GGA(s(X), Y) → U3_GGA(Y, sub_in_gga(X, Y))

The TRS R consists of the following rules:

sub_in_gga(s(X), s(Y)) → U6_gga(sub_in_gga(X, Y))
sub_in_gga(X, 0) → sub_out_gga(X)
U6_gga(sub_out_gga(Z)) → sub_out_gga(Z)

The set Q consists of the following terms:

sub_in_gga(x0, x1)
U6_gga(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


DIV_S_IN_GGA(s(X), Y) → U3_GGA(Y, sub_in_gga(X, Y))
The remaining pairs can at least be oriented weakly.

U3_GGA(Y, sub_out_gga(R)) → DIV_S_IN_GGA(R, Y)
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(DIV_S_IN_GGA(x1, x2)) = x1 + x2   
POL(U3_GGA(x1, x2)) = x1 + x2   
POL(U6_gga(x1)) = x1   
POL(s(x1)) = 1 + x1   
POL(sub_in_gga(x1, x2)) = x1   
POL(sub_out_gga(x1)) = x1   

The following usable rules [17] were oriented:

sub_in_gga(X, 0) → sub_out_gga(X)
sub_in_gga(s(X), s(Y)) → U6_gga(sub_in_gga(X, Y))
U6_gga(sub_out_gga(Z)) → sub_out_gga(Z)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
QDP
                            ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

U3_GGA(Y, sub_out_gga(R)) → DIV_S_IN_GGA(R, Y)

The TRS R consists of the following rules:

sub_in_gga(s(X), s(Y)) → U6_gga(sub_in_gga(X, Y))
sub_in_gga(X, 0) → sub_out_gga(X)
U6_gga(sub_out_gga(Z)) → sub_out_gga(Z)

The set Q consists of the following terms:

sub_in_gga(x0, x1)
U6_gga(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 1 less node.